# !/usr/bin python3                                
# encoding: utf-8 -*-
# @file: base_tools_api.py                       
# @author   : wjd
# @Time: 2023/8/23 15:28
from common.client import RequestsClient
from common.file_load import load_yaml_file


class BaseToolsApi(RequestsClient):
    prime_admin_token = ''  # 初始定义是个空值，那么在整个框架层面，必须先完成该属性的赋值

    def __init__(self):
        super().__init__()
        self.host = load_yaml_file('/config/http.yml')[f'xxljob_test2']
        self.headers = {
            "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
            "Accept": "application/json, text/plain, */*",
            "Cookie": "_ga=GA1.1.1242987414.1688539894; XXL_JOB_LOGIN_IDENTITY=7b226964223a312c22757365726e616d65223a2261646d696e222c2270617373776f7264223a226531306164633339343962613539616262653536653035376632306638383365222c22726f6c65223a312c227065726d697373696f6e223a6e756c6c7d; _ga_8SGN8450V8=GS1.1.1690424314.42.1.1690424316.0.0.0; _ga_HPV80BMWRB=GS1.1.1692756268.59.1.1692756294.0.0.0"
        }


class BaseToolsApitt(RequestsClient):
    prime_admin_token = ''

    def __init__(self):
        super().__init__()
        self.host = load_yaml_file('/config/http.yml')[f'xxljob_test{self.env}']
        self.headers = {
            "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
            "Accept": "application/json, text/plain, */*",
            "Cookie": '_ga=GA1.1.1242987414.1688539894; _ga_8SGN8450V8=GS1.1.1690424314.42.1.1690424316.0.0.0; _ga_HPV80BMWRB=GS1.1.1693467903.91.1.1693469254.0.0.0',
            "Authorization": "Bearer 941854ab8cc04a16b23a0fe2b1814e29"
        }


class BaseToolsApiDashboard(RequestsClient):
    prime_admin_token = ''

    def __init__(self):
        super().__init__()
        self.host = load_yaml_file('/config/http.yml')[f'prime_sp_test1']
        self.headers = {
            "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
            "Accept": "application/json, text/plain, */*",
            "Cookie": '_ga=GA1.1.1242987414.1688539894; _ga_8SGN8450V8=GS1.1.1690424314.42.1.1690424316.0.0.0; _ga_HPV80BMWRB=GS1.1.1696663256.176.0.1696663256.0.0.0',
            "Authorization": "Bearer dc8b78d8cfce4f15bad1f4b317a85561"
        }
